package com.smasher.backup.dialog;

import android.app.Dialog;
import android.view.ViewGroup;
import android.view.Window;


/**
 * @author HXZ_Android
 */
public abstract class BaseDialog extends BaseDialogFragment {


    @Override
    public void onStart() {
        super.onStart();
        Dialog dialog = getDialog();

        if (dialog != null) {
            Window window = dialog.getWindow();
            if (window != null) {
                window.setLayout(getWidth(), getHeight());
            }
        }

    }

    /**
     * can use{@link ViewGroup.LayoutParams#MATCH_PARENT}
     * or {@link ViewGroup.LayoutParams#WRAP_CONTENT}
     * or exactly number
     */
    protected abstract int getWidth();

    /**
     * can use{@link ViewGroup.LayoutParams#MATCH_PARENT}
     * or {@link ViewGroup.LayoutParams#WRAP_CONTENT}
     * or exactly number
     */
    protected abstract int getHeight();


}
